package test.work;


import lombok.SneakyThrows;

import java.util.concurrent.CompletableFuture;

/**
 * @Author: gcr
 * @Date: 2021/10/13 16:30
 */
public class DownpMImage {

    public static Integer breakSize = 100000;
    public static String rootPath = "F:\\pubmed\\";

    public static Integer threadSize = 300;

    @SneakyThrows
    public static void main(String[] args) {

        CompletableFuture[] futures2 = new CompletableFuture[5];
        // 同时开启四个任务
//        futures2[0] = CompletableFuture.runAsync(() -> DownpMImage1_150.main(args));
//        futures2[1] = CompletableFuture.runAsync(() -> DownpMImage151_174.main(args));
//        futures2[2] = CompletableFuture.runAsync(() -> DownpMImage175_200.main(args));
//        futures2[3] = CompletableFuture.runAsync(() -> DownpMImage201_225.main(args));
//        futures2[4] = CompletableFuture.runAsync(() -> DownpMImage226_250.main(args));
//        futures2[5] = CompletableFuture.runAsync(() -> DownpMImage251_275.main(args));
//        futures2[6] = CompletableFuture.runAsync(() -> DownpMImage276_300.main(args));
//        futures2[7] = CompletableFuture.runAsync(() -> DownpMImage301_325.main(args));
//        futures2[8] = CompletableFuture.runAsync(() -> DownpMImage326_394.main(args));


        futures2[0] = CompletableFuture.runAsync(() -> DownpMImage301_325.main(args));
        futures2[1] = CompletableFuture.runAsync(() -> DownpMImage326_340.main(args));
        futures2[2] = CompletableFuture.runAsync(() -> DownpMImage341_360.main(args));
        futures2[3] = CompletableFuture.runAsync(() -> DownpMImage361_380.main(args));
        futures2[4] = CompletableFuture.runAsync(() -> DownpMImage381_398.main(args));
//        futures2[5] = CompletableFuture.runAsync(() -> DownpMImage251_275.main(args));
//        futures2[6] = CompletableFuture.runAsync(() -> DownpMImage276_300.main(args));
//        futures2[7] = CompletableFuture.runAsync(() -> DownpMImage301_325.main(args));
//        futures2[8] = CompletableFuture.runAsync(() -> DownpMImage326_394.main(args));


        CompletableFuture.allOf(futures2).get();
    }


}
